﻿/**
 * pixSWX is SWXformat API for pixLib
 *  
 * Copyright © 2007 Laurent Deketelaere, Aral Balkan, Francis Bourre
 * Part of the SWX (SWF Data Exchange Format) project. http://swxformat.org
 * Part of the pixLib project. http://pixlib.org
 *
 * Released under the open source MIT license.
 * http://opensource.org/licenses/mit-license.php
 */
import com.bourre.log.LogChannel;
import com.bourre.log.LogLevel;
import com.bourre.log.Logger;
import com.bourre.log.PixlibStringifier;
import com.bourre.utils.ClassUtils;

class org.triptyk.pixswx.SWXDebug 
{
	public static var isOn : Boolean = true;
	public static var channel : LogChannel = new LogChannel(ClassUtils.getFullyQualifiedClassName(new SWXDebug()));

	public static function DEBUG( o ) : Void
	{
		if (SWXDebug.isOn) Logger.LOG(o, LogLevel.DEBUG, SWXDebug.channel);
	}

	public static function INFO( o ) : Void
	{
		if (SWXDebug.isOn) Logger.LOG(o, LogLevel.INFO, SWXDebug.channel);
	}

	public static function WARN( o ) : Void
	{
		if (SWXDebug.isOn) Logger.LOG(o, LogLevel.WARN, SWXDebug.channel);
	}

	public static function ERROR( o ) : Void
	{
		if (SWXDebug.isOn) Logger.LOG(o, LogLevel.ERROR, SWXDebug.channel);
	}

	public static function FATAL( o ) : Void
	{
		if (SWXDebug.isOn) Logger.LOG(o, LogLevel.FATAL, SWXDebug.channel);
	}

	public function toString() : String 
	{
		return PixlibStringifier.stringify(this);
	}
}